package com.walter.controller;

import java.util.Date;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.walter.pojo.User;
import com.walter.pojo.WalterJSONResult;

//@Controller
@RestController
@RequestMapping("/user")
public class UserController {

	@RequestMapping("/getUser")
//	@ResponseBody
	public User getUser() {
		User user = new User();
		user.setName("walter");
		user.setAge(18);
		user.setBirthday(new Date());
		user.setPassword("123");
//		user.setDesc("");
		return user;
	}

	@RequestMapping("/getUserJson")
//	@ResponseBody
	public WalterJSONResult getUserJson() {
		User user = new User();
		user.setName("walter");
		user.setAge(18);
		user.setBirthday(new Date());
		user.setPassword("123");
//		user.setDesc("");
		return WalterJSONResult.ok(user);
	}
}
